<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<!-- jQuery-easyui -->
	<jsp:include page="/include/jQuery.easyui.lib.jsp"></jsp:include>
</head>
<body>
	
	<div style="padding: 10px;">
	<form class="op-form" id="addForm" name="addForm" method="post" enctype="multipart/form-data" action="seller.action?command=add">
		<input type="hidden" name="id" value="${sellerEnt.id }">
		<table>
			<tr>
				<td>用户名:</td>
				<td>
					<input class="easyui-validatebox" name="code" validType="length[1,12]" value="${sellerEnt.code }">
				</td>
			</tr>
			<tr>
				<td>商户名称:</td>
				<td>
					<input class="easyui-validatebox" name="name" required="true" validType="length[2,12]" value="${sellerEnt.name }">
				</td>
			</tr>
			<tr>
				<td>联系人:</td>
				<td>
					<input class="easyui-validatebox" name="contact" required="true" maxlength="4" validType="chinese;length[2,12]"  value="${sellerEnt.contact }">
				</td>
			</tr>
			<tr>
				<td>营业执照:</td>
				<td>
					<input type="file" name="image">
					<img alt="" src="${pageContext.request.contextPath }/images/license/${image}">
				</td>
			</tr>
			<tr>
				<td>
					<a id="btnSubmit" href="#" class="easyui-linkbutton" icon="icon-ok" onclick="addSeller();">提交</a>
				</td>
				<td>
					<a href="#" class="easyui-linkbutton" icon="icon-cancel" onclick="addForm.reset()">重置</a>
					<a href="${pageContext.request.contextPath }/application/yyj/seller/main.jsp" class="easyui-linkbutton" icon="icon-redo">返回</a>
				</td>
			</tr>
		</table>
	</form>
</div>

<script type="text/javascript">
	
	var flag = true;
	
	function addSeller(){
		// $('#addForm').submit();
		if($('#addForm').form('validate')){
			$("#btnSubmit").linkbutton({disabled: true});
			addForm.submit();
		}
	}
	
	$(document).ready(function(){
		
		if('${result}' !== ""){
			if ("true" === '${result}'){
				$.messager.alert("友情提示", "您的操作成功!", "info");
			}else{
				$.messager.alert("友情提示", "您的操作失败!", "error");
			}
		}
	});
	
</script>
	
</body>
</html>